﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace serie02_2_guiComponent
{
    class Circle:System.Windows.Forms.Control
    {
        protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
        {
            base.OnPaint(e);

            // Pen + Rectangle
            System.Drawing.Pen pen = new System.Drawing.Pen(System.Drawing.Color.Red);
            System.Drawing.Rectangle rect = new System.Drawing.Rectangle(0, 0, this.Width - 1, this.Height - 1);

            // Rahmen
            e.Graphics.DrawRectangle(pen, rect);

            // Kreis
            rect.Inflate(-1, -1);
            pen.Color = System.Drawing.Color.BlueViolet;
            e.Graphics.DrawEllipse(pen, rect);
        }
    }
}
